package mylib.archive.y2012.m08.SNSS_R3;

import mylib.dir.FastInputReader;

import java.io.PrintWriter;

public class taskA {
    public void solve(int testNumber, FastInputReader in, PrintWriter out) {
        for (; ; ) {
            long n = in.nextLong();
            if (n == 0)
                break;
            // n*(n+1)/2-k=s
            long l = 0, r = 1000000000, res = Long.MAX_VALUE;
            while (l <= r) {
                long m = (l + r) / 2;
                long val = m * (m + 1) / 2;
                if (val > n) {
                    res = Math.min(res, m);
                    r = m - 1;
                } else {
                    l = m + 1;
                }
            }
            out.println(res + " " + (res * (res + 1) / 2 - n));
        }
    }
}
